View Javadoc
1   package edu.jiangxin.apktoolbox.file.password.recovery.checker.thirdparty;
2   
3   import edu.jiangxin.apktoolbox.utils.Constants;
4   
5   public class ThirdPartyWinRarChecker extends AbstractThirdPartyChecker {
6       @Override
7       public String[] getFileExtensions() {
8           return new String[]{"rar", "zip", "7z", "arj", "bz2", "cab", "gz", "iso", "jar", "lz", "lzh", "tar", "uue", "xz", "z", "zst"};
9       }
10  
11      @Override
12      public String getFileDescription() {
13          return "*.rar; *.zip; *.7z; ...";
14      }
15  
16      @Override
17      public String getDescription() {
18          return "ThirdPartyWinRarChecker(Using WinRar.exe)";
19      }
20  
21      @Override
22      public String getToolPath() {
23          return conf.getString(Constants.WIN_RAR_PATH_KEY);
24      }
25  
26      @Override
27      public boolean isFiltered(String password) {
28          if (password != null && password.contains("\"")) {
29              // It is useless to escape the password
30              logger.warn("checkPassword password contain double quote characters[Not Supported]");
31              return true;
32          }
33          return false;
34      }
35  
36      @Override
37      public String getCmd(String password) {
38          String target = file.getAbsolutePath();
39          return String.format("%s t -inul -ibck -p\"%s\" \"%s\"", toolPath, password, target);
40      }
41  }